package com.jerei.web.plugin.api;

import com.alibaba.fastjson.JSONObject;
import org.springframework.ui.Model;
import ro.fortsoft.pf4j.ExtensionPoint;
import ro.fortsoft.pf4j.Plugin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by sunfeihu on 2016/11/24.
 * 插件配置扩展点
 */
public interface IPluginConfig extends ExtensionPoint {

    /**
     * 获取插件配置表单
     *
     * @return 配置信息
     */
    public String pluginConfig(HttpServletRequest request, HttpServletResponse response, Model model, Plugin plugin);

    /**
     * 保存或者修改配置文件
     */
    public String savePluginConfig(HttpServletRequest request, HttpServletResponse response, Model model, Plugin plugin);

    /**
     * 获取插件配置信息
     *
     * @return 插件配置信息的JSON格式
     */
    public JSONObject config();
}